import request from '@/utils/request'

// 获取所有部门
export const getDepartmentList = () => {
  return request({
    url: '/company/department'
  })
}

// 获取部门负责人
export const getManagerList = () => {
  return request({
    url: '/sys/user/simple'
  })
}

// 调新增接口的函数
export const addDepartment = (data) => {
  return request({
    method: 'POST',
    url: '/company/department',
    // data: {五个属性}
    data: data
  })
}

// 利用id调获取组织架构详情接口的函数
export const getDepartmentDetail = (id) => {
  return request({
    url: `/company/department/${id}`
  })
}

// 调修改部门接口的函数
export const updateDepartment = (id, data) => {
  return request({
    method: 'PUT',
    url: `/company/department/${id}`,
    // data: { 7个属性 }
    data: data
  })
}

// 利用id调删除接口的函数
export const delDepartment = (id) => {
  return request({
    method: 'DELETE',
    url: `/company/department/${id}`
  })
}

